package com.navajo.web.business.page;

import org.springframework.beans.factory.annotation.Autowired;

import com.google.common.eventbus.EventBus;
import com.navajo.web.business.view.navigation.NavigationView;
import com.navajo.web.business.view.searchone.SearchFrame;
import com.navajo.web.spring.MessageSource;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.Navigator.ComponentContainerViewDisplay;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.VerticalLayout;

public class MainPage extends VerticalLayout {
    @Autowired
    private NavigationView navigationView;
    @Autowired
    private SideBarMenu    sideBarMenu;
    @Autowired
    private SearchFrame    searchFrame;
    @Autowired
    private MessageSource  messageSource;
    @Autowired
    private EventBus       bus;



    public MainPage() {
    }



    Navigator navigator;
    
    @Autowired
    private void init() {
        addComponent(navigationView);
        addComponent(sideBarMenu);
        HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
        addComponent(horizontalSplitPanel);
        
        horizontalSplitPanel.setSizeFull();
        horizontalSplitPanel.addStyleName("page");
        horizontalSplitPanel.setFirstComponent(new NativeButton(messageSource.getMessage("left")));
        
        
        
        
        horizontalSplitPanel.setSecondComponent(new NativeButton("Right"));
    }



    public void navigateTo(String card) {
        searchFrame.show();
    }
}
